package cn.trigram.excel.jxls;

import java.util.Locale;

import org.junit.jupiter.api.extension.AfterEachCallback;
import org.junit.jupiter.api.extension.BeforeEachCallback;
import org.junit.jupiter.api.extension.ExtensionContext;

/**
 * Sets locale for testcase to ENGLISH.
 */
public class EnglishTestRule implements AfterEachCallback, BeforeEachCallback {

    @Override
    public void afterEach(ExtensionContext context) throws Exception {
        Locale before = Locale.getDefault();
        Locale.setDefault(Locale.ENGLISH);
        try {
//            base.evaluate();
        } finally {
            Locale.setDefault(before); // restore
        }
    }

    @Override
    public void beforeEach(ExtensionContext context) throws Exception {

    }

}
